<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
    <modelVersion>4.0.0</modelVersion>

    <parent>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter-parent</artifactId>
        <version>3.2.4</version>
        <relativePath/> <!-- lookup parent from repository -->
    </parent>

    <groupId>ru.gozhan</groupId>
    <artifactId>java-project-template</artifactId>
    <version>0.0.1-SNAPSHOT</version>
    <name>java-project-template</name>
    <description>java-project-template</description>

    <properties>
        <java.version>22</java.version>

        <rest-assured.verion>5.4.0</rest-assured.verion>
        <testcontainer-postgres.version>1.19.7</testcontainer-postgres.version>

        <postgresql.version>42.7.3</postgresql.version>
        <liquibase.version>4.27.0</liquibase.version>

        <lombok.version>1.18.30</lombok.version>

        <xml-format.version>3.3.1</xml-format.version>
        <checkstyle.version>3.3.1</checkstyle.version>
        <jacoco.version>0.8.11</jacoco.version>
    </properties>

    <dependencies>
        <!--        Spring boot starters-->
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-web</artifactId>
        </dependency>

        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-test</artifactId>
            <scope>test</scope>
        </dependency>

        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-configuration-processor</artifactId>
        </dependency>

        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-data-jdbc</artifactId>
        </dependency>

        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-actuator</artifactId>
        </dependency>


        <!--        Tests-->
        <!--        -->
        <dependency>
            <groupId>io.rest-assured</groupId>
            <artifactId>rest-assured</artifactId>
            <version>${rest-assured.verion}</version>
            <scope>test</scope>
        </dependency>

        <dependency>
            <groupId>org.testcontainers</groupId>
            <artifactId>postgresql</artifactId>
            <version>${testcontainer-postgres.version}</version>
            <scope>test</scope>
        </dependency>


        <!--        Postgres-->
        <dependency>
            <groupId>org.postgresql</groupId>
            <artifactId>postgresql</artifactId>
            <version>${postgresql.version}</version>
        </dependency>

        <dependency>
            <groupId>org.liquibase</groupId>
            <artifactId>liquibase-core</artifactId>
            <version>${liquibase.version}</version>
        </dependency>


        <!--        Monitoring-->
        <!--        -->


        <!--        Utils-->
        <dependency>
            <groupId>org.projectlombok</groupId>
            <artifactId>lombok</artifactId>
            <optional>true</optional>
            <version>${lombok.version}</version>
        </dependency>
    </dependencies>

    <build>
        <plugins>
            <plugin>
                <groupId>org.springframework.boot</groupId>
                <artifactId>spring-boot-maven-plugin</artifactId>
                <configuration>
                    <excludes>
                        <exclude>
                            <groupId>org.projectlombok</groupId>
                            <artifactId>lombok</artifactId>
                        </exclude>
                    </excludes>
                </configuration>
            </plugin>
            <plugin>
                <groupId>au.com.acegi</groupId>
                <artifactId>xml-format-maven-plugin</artifactId>
                <version>${xml-format.version}</version>
                <executions>
                    <execution>
                        <id>xml-format</id>
                        <goals>
                            <goal>xml-format</goal>
                        </goals>
                        <configuration>
                            <indentSize>4</indentSize>
                            <keepBlankLines>true</keepBlankLines>
                            <lineEnding>LF</lineEnding>
                            <includes>pom.xml</includes>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-checkstyle-plugin</artifactId>
                <version>${checkstyle.version}</version>
                <configuration>
                    <configLocation>sun_checks.xml</configLocation>
                    <consoleOutput>true</consoleOutput>
                    <failsOnError>true</failsOnError>
                    <linkXRef>false</linkXRef>
                </configuration>
                <executions>
                    <execution>
                        <id>validate</id>
                        <phase>validate</phase>
                        <goals>
                            <goal>check</goal>
                        </goals>
                        <configuration>
                            <suppressionsFileExpression>
                                checkstyle.suppressions.file
                            </suppressionsFileExpression>
                            <suppressionsLocation>checkstyle-suppressions.xml
                            </suppressionsLocation>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>org.jacoco</groupId>
                <artifactId>jacoco-maven-plugin</artifactId>
                <version>${jacoco.version}</version>
                <executions>
                    <execution>
                        <id>default-prepare-agent</id>
                        <goals>
                            <goal>prepare-agent</goal>
                        </goals>
                    </execution>
                    <execution>
                        <id>report</id>
                        <phase>prepare-package</phase>
                        <goals>
                            <goal>report</goal>
                        </goals>
                    </execution>
                    <execution>
                        <id>check</id>
                        <goals>
                            <goal>check</goal>
                        </goals>
                        <configuration>
                            <rules>
                                <rule implementation="org.jacoco.maven.RuleConfiguration">
                                    <element>PACKAGE</element>
                                    <limits>
                                        <limit implementation="org.jacoco.report.check.Limit">
                                            <counter>INSTRUCTION</counter>
                                            <value>COVEREDRATIO</value>
                                            <minimum>0.60</minimum>
                                        </limit>
                                    </limits>
                                    <includes>
                                        <include>
                                            ru.gozhan.financialtrackertgbot.service.impl
                                        </include>
                                    </includes>
                                </rule>
                            </rules>
                        </configuration>
                    </execution>
                </executions>
                <configuration>
                    <excludes>
                        <exclude>**/JavaProjectTemplateApplication.class
                        </exclude>
                        <exclude>**/*DTO.*</exclude>
                        <exclude>**/config/*</exclude>
                    </excludes>
                </configuration>
            </plugin>
        </plugins>
    </build>

</project>
